062 functions
您好,在本视频中,我们将创建一个函数,在该函数中我们将使用我们的编程语言。
Hello, in this video, we are going to create a function and in this function we will use our programming language.
好的,我会。
OK, I will.
然后我在这里创建了一个新函数。
I created a new function in here then.
我们现在就看看。
We will see now.
这是第一个方块下的区块。
And this is block under square one.
这是函数名称。
This is the function name.
在这个函数中,我们会做什么?
And in this function, what will we do?
例如,我们可以说,嗯,变量。
For example, we can say, um, variable.
例如,一,因为我们能够拉动我们,所以我们能够好,在这里我将其定义为全局内存和整数,好,并且。
For example, one, because we're able to pull us, we're able to be OK and in here I will define this as global memory and as integer, OK, and.
我将定义的第二个变量,您将在通常的主要组织博客中看到,它们只是本地和备忘录以及输入和输出,但现在您可以看到本地 tump、本地输入和输出、本地艺术和本地输入选项已激活。
The second variable that I will define and you will see in the normally main organization blog that were just a local and memo and input and output, but now you can see local tump, local in and out, local art and local in options are activated.
但这并不重要。
But it doesn't matter.
这将是全球记忆,这将再次成为全球记忆。
It will be global memory and this will be global memory again.
现在,重要的事情就在这里。
Now, the important thing is here.
这就是我们的功能。
This is our function.
好的,现在这个功能将继续运行,或者可能不会激活。
OK, and now this function will continue to run or it will be active in may not be.
我们应该怎么做?
How can we do this?
我们去这里和这里吧。
Let's go to here and in here.
我会。
I will.
通过拖放方法,我将把我的功能放在这里。
With the drag and drop method, I will put my function to here.
而这个功能就分配到这里了。
And this function is assigned to here.
这个函数会做什么呢?
And what will this function do?
此功能将转到 8 m w ,在这里您可以转到 Sirtex 文本区域,在这里您将看到 N.W.
This function is going to go to eight m w to and in here you can you can go to Sirtex text area and in here you will see N.W.
2 和 4 将相加并写入 MW 零。
two and four will be added and will be written to M W zero.
那么让我们去 Main Albe 并启动模拟器。
So let's go to Main Albe and let's start simulator.
此时,模拟器启动后,我们将仅更改 M 2 和 W4,我们将检查结果是否更改或我们的功能是否正常工作。
And at this moment also and after Simulator's started, we will change just M two and W4 and the result we are going to check the result is a changing or not or our function is working or not.
现在CPU处于运行和停止状态,项目正在编译。
Now the CPU is in the run and stop condition and the project is compiling and.
一会儿就应该完成了。
It should be finished in a moment.
一分钟后,我就在等待,并且百分百高兴。
In a minute, I'm waiting and one hundred percent pleasure.
好的。
OK.
现在,我想将此项目下载到我的模拟器并再次启动模块并完成。
Now, I want to do a download this project to my simulator and start modules again and finish.
现在我们可以在这里插入两块钱,好的,这将是移动和。
Now we can insert two bucks to here, OK, this will be move and.
这也将是移动。
This will be also move.
好的,我会站什么,例如,嗯,m w 例如,Tan 将移到这里。
OK, and what will I stand, for example, um, m w for example, Tan will be moved to here.
分子量为二。
M w two.
好的,m w 12 将移至 m w 4。
OK, and m w 12 is going to move to m w four.
好的,结果将返回并且 W 为零。
OK, and the result will be returning and W zero.
所以我们这里也可以多说一句。
So we can also saying here one more.
我们可以说,或者我们可以把这个更多地不放在这里。
And we can say or we can put this more not to here.
就在这里耽搁了。
It's delayed it in here.
我想把它。
I want to put it.
W 零将返回到 MMW,例如 20,好的,这将是我们的结果。
W zero is going to return to MMW, for example, 20, OK, this will be a result of us.
所以现在这个函数将被运行。
So now this function will be run.
我会再次做很多很多事情,我们已经准备好上线了。
I will do a lot again and lot and we are ready and go online.
现在,让我们在这里进行监控,当监控被激活时,您将看到 this 为零,这些值也为零。
Now, let's monitoring now in here, when the monitoring is activated, you will see this is zero and these values are zero.
所以我会改变这个策略。
So I will change this tack.
今年夏天的监测显示格式。
Monitoring to monitor to display formats this summer.
好吧,这也应该是。
OK, and this should be also.
在这里,嗯,谈谈。
In here, um, talk.
不是自动的,我们没有选择。
Not automatically, we didn't selected.
显示格式又讲和小数,现在这个讲,也应该讲和小数。
Display format and talk and decimal, and now this talk, too, should be talked and decimal.
所以让我们改变它。
So let's change it.
我修改一下这个操作数,可以吗?
I will modify this operand, OK?
我会写信给 MWI 五点。
I will write to MWI to five.
所以结果是五。
So the result is five.
好的,您可以明白为什么是这样了,因为我们将 MWI 添加到 M W4 中,结果被写入零。
OK, you can see why we are because we are adding MWI to with M W4 and the result is written to zero.
在这个函数里面。
Inside this function.
好的,现在让我们将该音量更改为时间。
OK, and now let's change this volume to for example, time.
结果是 21 y,因为我们在这里将其更改为十六进制并将操作数修改为十进制。
And the result is 21 y because we change it to as hexadecimal and modify operant as decimal in here.
好的,那就抓紧时间吧。
OK, and make it time then.
结果是十加五。
The result is ten plus five.
结果是这里有 15 个。
Result is 15 were in here.
好的,在这个块中,我们将变量添加到变量三,并将其写入 Raible 1,然后让我们转到 Main 或再次。
OK, in this block we are adding variable to and variable three and we are writing it to raible one and let's go to Main or be once again.
如果我将此值更改为例如时间,结果将被写入 M 零,结果就是现在的结果。
And if I change this value to for example, time, the result will be written to M zero and the result is now it is.
十六进制值并不是十六进制值,十进制值也是十进制。
Sixteen and not hexadecimal value, decimal value and ten.
好的,10。
OK, 10.
结果是 20,20 移至 MWI 20。
The result is 20 and 20 is moved to MWI 20.
那么我们如何创建一个函数呢?
So this is how can we create a function?
如果我去块一怎么用这个功能呢?
How can we use this function if I go to block one?
如果我说,例如,嗯,例如,变量。
And if I say, for example, um, for example, variable.
想象一下五,我想修改这个函数,它调用例如变量。
Imagine five, I want to modify this function, it calls to, for example, variable.
例如,一乘以五,会发生什么,这个变量五将是全局内存,其值将是 MWC。
One multiplied by, for example, five, what will happen, this variable five is going to be global memory and the value is going to be MWC.
好的,现在我可以去这里,在这里我可以说。
OK, and now I can go to here and in here I can say.
再次例如,mu m m。
For example, again, mu m m.
W6 将在 MWI 22 前往英国并下载该项目和很多内容,现在我们已经准备好了。
W6 is going to Britain, MWI 22 and do a download this project and lot and now we are ready.
所以结果是 100,因为我们要进行乘法。
So the result is 100 because of why we are multiplying.
我们非常能干一除五,五乘以二十就等于100。
We are very able one with five and five multiplied by twenty it equals to 100.
好的,所以结果是一百。
OK, so the result is one hundred.
例如,如果我在此处更改此值,则修改操作数不是十六进制而是十进制。
If I change this value in here, modify operand is not hexadecimal is decimal for example.
二十五,所以二十五乘以对不起,加上编辑时间,结果是三十五。
Twenty five so twenty five multiplied by I am sorry adding by edit by time and the result is thirty five.
三十五乘以五。
Thirty five multiplied by five.
结果是一百七十五。
The result is one hundred and seventy five.
所以这个函数总是在运行,并且这个函数循环总是在工作。
So this function is always running and always this function loop is working.
在主要的 Olby 中,我们使用了一个小图表,但在函数中,我们可以使用特殊的编程语言,如果像这样,就非常非常容易,它可以使我们的程序有点短,并且可以为我们的程序添加功能。
And in the main Olby we are using a little diagram but in the function we can use special programming language is very, very easy if like this and it can make a little bit short our programs and it can add a functionality to our program.
这个视频一直没看完。
Always unfinished for this video.
下一个视频见。
See you in the next video.